package com.gimi.cloud.bbp.task.service;


import com.gimi.cloud.bbp.dto.task.ScheduleJobDTO;

/**
 * 定时任务相关service实现类
 *
 * @author wbj
 * @version 1.0
 * @Description
 * @create 2018-01-08
 **/
public interface ScheduleJobService {
    /**
     * 根据定时任务唯一标识，获取定时任务key
     * @param dto
     * @param jobKey
     * @return
     * @throws Exception
     */
    ScheduleJobDTO getScheduleJobByJobKey(ScheduleJobDTO dto, String jobKey) throws Exception;

    /**
     * 新创建一个定时任务
     * @param scheduleJob
     */
    void createScheduleJob(ScheduleJobDTO scheduleJob);

    /**
     * 更新定时任务
     * @param scheduleJob
     */
    void updateScheduleJob(ScheduleJobDTO scheduleJob);

    /**
     * 删除定时任务
     * @param scheduleJob
     */
    void deleteScheduleJob(ScheduleJobDTO scheduleJob);

    /**
     * 立即执行定时任务
     * @param scheduleJob
     */
    void runScheduleJob(ScheduleJobDTO scheduleJob);

    /**
     * 暂停定时任务
     * @param scheduleJob
     */
    void pauseScheduleJob(ScheduleJobDTO scheduleJob);

    /**
     * 恢复定时任务
     * @param scheduleJob
     */
    void resumeScheduleJob(ScheduleJobDTO scheduleJob);

}
